#include <bits/stdc++.h>
using namespace std;

int n, a[100005], ans, used = 0;
map<int, int> s, use;

signed main() {
    freopen("duel.in", "r", stdin);
    freopen("duel.out", "w", stdout);
    cin >> n;
    for (int i = 1; i <= n; i++)
        cin >> a[i];
    sort(a + 1, a + n + 1);
    s[0] = 1000050;
    for (int i = 1; i <= n; i++)
        s[a[i]]++, use[a[i]]++;
    ans = n;
    while (used < n) {
        int lid = 0, lk = 0;
        for (auto kv : s) {
            int killed = min(lk, kv.second);
            if (lid != 0) ans -= killed;
            used += killed;
            use[kv.first] -= killed;
            s[lid] -= killed;
            if (kv.first == 0) killed = 1000050;
            if (s[lid] == 0) s.erase(lid);
            lid = kv.first, lk = killed;
        }
    }
    cout << ans << '\n';
    return 0;
}
